#include <iostream>
#include "Search.hpp"
#include <cstdio>

const string input = "data/raw_html/raw.txt";

int main()
{
    project_search::search* test_search =  new project_search::search();
    test_search->Initsearch(input);

    string keyword;
    string json_word;

    char inbuffer[1024];

    while(true)
    {
      cout<<"Please enter keyword :";
      fgets(inbuffer,sizeof(inbuffer)-1,stdin);
      cout << strlen(inbuffer) << endl;
      inbuffer[strlen(inbuffer)-1]= 0;//"\0"
      keyword = inbuffer;
      test_search->Search(keyword,&json_word);
      cout<<keyword<<endl;

      cout<<json_word<<endl;
    }
    return 0;
}
